# coding=utf-8
from django.db import models
from com.kjssoft.common.globals import DBTableAssist

__author__ = 'Sea'

class FileContentType(models.Model):
    type = models.IntegerField(unique=True)
    name = models.CharField(max_length=100, null=True, blank=True)

    def __unicode__(self):
        return 'file content type %s(%s)' % (self.name, self.type)

    class Mate:
        db_table = DBTableAssist.get_db_table_name('common_file_content_type')

class AbstractCommonFile(models.Model):
    """
    虚拟化的文件模型
    """
    uuid         = models.CharField(max_length=500, unique=True)
    name         = models.CharField(max_length=500, null=True, blank=True)
    size         = models.BigIntegerField()
    content_type = models.ForeignKey(FileContentType, related_name='file content type')

    class Meta:
        abstract = True
